from google.appengine.ext import db

class Article(db.Model):
    id = db.IntegerProperty(required=True)
    subject = db.StringProperty(required=True)
    shortness_content = db.TextProperty(required=True)
    full_content = db.TextProperty(required=True)
    create_date = db.DateTimeProperty(required=True)
    update_date = db.DateTimeProperty()
    category_id = db.IntegerProperty(required=True)
    view_cnt = db.IntegerProperty(default=0)
    
class Category(db.Model):
    id = db.IntegerProperty(required=True)
    cate_name = db.StringProperty(required=True)
    cate_desc = db.StringProperty()

class Sequence(db.Model):
    name = db.StringProperty(required=True)
    value = db.IntegerProperty(required=True)

class Comment(db.Model):
    id = db.IntegerProperty(required=True)
    username = db.StringProperty(required=True)
    content = db.StringProperty(required=True)
    create_date = db.DateTimeProperty(required=True)
    art_id = db.IntegerProperty(required=True)
    
class Tag(db.Model):
    art_id = db.IntegerProperty(required=True)
    val = db.StringProperty(required=True)
